package com.etone.smartAudit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.etone.smartAudit.domain.AccountInfo;
import com.etone.smartAudit.enums.AccountType;
import com.etone.smartAudit.vo.accountInfo.AccountInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: sovy
 * @date: 2020/11/12
 * @description:
 */

@Mapper
public interface AccountInfoMapper extends BaseMapper<AccountInfo> {

    /**
     * 查找账号信息
     *
     * @param adminId
     * @param serverId
     * @param serverName
     * @param serverIp
     * @param type
     * @param itemId
     * @return
     */
    List<AccountInfoVO> findList(@Param("adminId") Integer adminId, @Param("serverId") Integer serverId, @Param("serverName") String serverName, @Param("serverIp") String serverIp, @Param("type") AccountType type, @Param("itemId") Integer itemId);

    /**
     * 查找账号详情
     *
     * @param id
     * @return
     */
    AccountInfoVO findDetail(@Param("id") Integer id);

    /**
     * 查找账号详情
     *
     * @param serverId
     * @param itemId
     * @param accountType
     * @param isSupper    是否是超级管理员
     * @return
     */
    AccountInfoVO findOne(@Param("serverId") Integer serverId, @Param("itemId") Integer itemId, @Param("accountType") AccountType accountType, @Param("isSupper") Boolean isSupper);
}